﻿@model ModelsEntity
@{
	var PointName = ConfigHelper.Get<UserConfig>().PointName;
}
<div class="layui-row layui-col-space15">
	<div class="layui-col-md12">

		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">模型信息</div>
			<div class="layui-card-body" pad15>
				<form class="layui-form" asp-controller="CommonModel" asp-action="ModelEdit" wid100 method="post">
					@{
						if (Model.ModelID <= 0)
						{
							<div class="layui-form-item">
								<label class="layui-form-label">载入模板</label>
								<div class="layui-input-block">
									<select id="dropModelTemplate" name="dropModelTemplate" class="layui-input" asp-items="ViewBag.ModelTemplatesList"></select>
								</div>
							</div>
						}
					}
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>模型名称</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="ModelName" data-val="true" data-val-required="不能为空">
							<span asp-validation-for="ModelName" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>数据表名</label>
						<div class="layui-input-block">
							@{
								if (Model.ModelID <= 0)
								{
									<div class="layui-form-mid layui-word-aux">U_</div>
									<div class="layui-input-inline" style="width:50%;">
										<input type="text" class="layui-input" asp-for="TableName" data-val="true" data-val-required="不能为空" data-val-regex-pattern="^[\w_]+$" data-val-regex="只允许输入字母、数字或下划线" placeholder="只允许输入字母、数字或下划线" />
									</div>
									<div class="layui-form-mid layui-word-aux">
										<span asp-validation-for="TableName" style="color:red;"></span>
									</div>
								}
								else
								{
									<input type="text" readonly="readonly" class="layui-input layui-disabled" asp-for="TableName">
								}
							}
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>项目名称</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="ItemName" data-val="true" data-val-required="不能为空">
							<span asp-validation-for="ItemName" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>项目单位</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="ItemUnit" data-val="true" data-val-required="不能为空" placeholder="例如：篇、个、件">
							<span asp-validation-for="ItemUnit" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>模型描述</label>
						<div class="layui-input-block">
							<textarea class="layui-textarea" asp-for="Description"></textarea>
						</div>
					</div>
					@{
						if (Model.ModelType == 2)
						{
							<div class="layui-form-item">
								<label class="layui-form-label">商品性质</label>
								<div class="layui-input-block">
									<select asp-for="Character">
										<option value="1">实物</option>
										<option value="2">服务</option>
										<option value="4">下载</option>
										<option value="8">点卡</option>
									</select>
								</div>
							</div>
						}
					}
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>内容页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="DefaultTemplateFile" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>打印页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="PrintTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>栏目搜索页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="SearchTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>搜索表单页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="AdvanceSearchFormTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>高级搜索页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="AdvanceSearchTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>查看评论模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="CommentManageTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>会员发表页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="UserAddContentTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>匿名投稿页模板</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="AnonymouseTemplate" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>信息发布文件</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="AddInfoFilePath" placeholder="默认：Contents/ContentEdit" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>信息管理文件</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="ManageInfoFilePath" placeholder="默认：Contents/ContentManage" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>信息预览文件</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="PreviewInfoFilePath" placeholder="默认：Contents/ViewContent" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>批量设置文件</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="BatchInfoFilePath" placeholder="默认：Contents/ContentBatch" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>统计点击数</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="IsCountHits" lay-skin="switch" lay-text="已开启|已关闭">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red"></span>是否禁用</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="IsDisabled" lay-skin="switch" lay-text="已禁用|已启用">
						</div>
					</div>
					@{
						if (Model.ModelType == 1)
						{
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>启用收费</label>
								<div class="layui-input-block">
									<input type="checkbox" asp-for="IsEnableCharge" lay-skin="switch" lay-text="已开启|已关闭">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>静态页收费提示</label>
								<div class="layui-input-block">
									<textarea class="layui-textarea" asp-for="ChargeTips"></textarea>
									<span class="layui-bg-green">说明：生成静态页时的收费提示。支持HTML代码，特别标签有：{$ModelName}：模型名称；{$FileName}：文件夹名；{$Id}：信息的GeneralId；</span>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>@{@PointName}不足提示</label>
								<div class="layui-input-block">
									<textarea class="layui-textarea" asp-for="NeedPointChargeTips"></textarea>
									<span class="layui-bg-green">说明：@{@PointName}数额不足时的收费提示。支持HTML代码，特别标签有：{$InfoPoint}：需要@{@PointName}数；{$ItemName}：项目名称；{$NowPoint}：会员@{@PointName}；{$PointName}：@{@PointName}名称；{$PointUnit}：@{@PointName}单位；</span>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>有效期不足提示</label>
								<div class="layui-input-block">
									<textarea class="layui-textarea" asp-for="OutTimeChargeTips"></textarea>
									<span class="layui-bg-green">说明：有效期不足时的收费提示。支持HTML代码，特别标签有：{$ItemName}：项目名称；</span>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>收费信息的提示</label>
								<div class="layui-input-block">
									<textarea class="layui-textarea" asp-for="UsePointChargeTips"></textarea>
									<span class="layui-bg-green">
										说明：查看收费信息时的收费提示。支持HTML代码，特别标签有：{$ItemName}：项目名称；{$url}：阅读跳转路径；{$PointUnit}：@{@PointName}单位；{$NowPoint}：会员@{@PointName}；{$InfoPoint}：需要@{@PointName}数；{$PointName}：@{@PointName}名称；{$FinalPoint}：剩余@{@PointName}数；{$InstallDir}：不阅读虚拟路径；
									</span>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>启用签收</label>
								<div class="layui-input-block">
									<input type="checkbox" asp-for="IsEnableSignin" lay-skin="switch" lay-text="已开启|已关闭">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label"><span class="c-red"></span>启用投票</label>
								<div class="layui-input-block">
									<input type="checkbox" asp-for="IsEnableVote" lay-skin="switch" lay-text="已开启|已关闭">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">开启验证码</label>
								<div class="layui-input-inline" style="width:100px;">
									<input type="checkbox" asp-for="IsVerificationCode" lay-skin="switch" lay-text="已开启|已关闭">
								</div>
								<div class="layui-form-mid layui-word-aux">
									用户前台发表信息时是否开启验证码
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">发表内容限制数</label>
								<div class="layui-input-inline" style="width:100px;">
									<input type="text" class="layui-input" asp-for="MaxPerUser" />
								</div>
								<div class="layui-form-mid layui-word-aux">
									用户在此模型下发表内容的限制数，如果为0表示没有限制。
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">是否子母表模型</label>
								<div class="layui-input-block">
									<input type="checkbox" asp-for="IsParentChild" lay-skin="switch" lay-text="是|否">
								</div>
							</div>
						}
					}
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="">保存</button>
							<button type="button" class="layui-btn layuiadmin-btn-list" onclick="layer_close()">取消</button>
							<input type="hidden" asp-for="ModelID" />
							<input type="hidden" asp-for="ModelType" />
							<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
						</div>
					</div>
					@Html.AntiForgeryToken()
				</form>
			</div>
		</div>
	</div>
</div>